// Math.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"


int _tmain(int argc, _TCHAR* argv[])
{
	return 0;
}

//Program math0.1 Beta linux version

#include <iostream>
#include <windows.h>
#include <stdlib.h>
#include <iomanip>
using namespace std;

int main()
{
{
    system("cls");
	cout << "Program Math 0.1 Beta by 50cent2513\n";
	cout << "===================================\n";
	cout << "Windows version in c++\n";
	cout << "====================\n";
	Sleep(3000);
	system("cls");
}

do
{
cout << "Vuvedete vashiq izbor sledvan ot Enter.\n";
cout << "=======================================\n";
cout << "1.Lice i perietur na triugulnik\n";
cout << "2.Lice i perietur na pravougulen triugulnik\n";
cout << "3.Lice i perietur na pravougulnik\n";
cout << "4.Lice i perietur na kvadrat\n";
cout << "5.Lice i perietur na trapec\n";
cout << "6.Obkolka i lice na okrujnost\n";
cout << "7.Lice i perietur na romb\n";
cout << "8.Lice i perietur na usporednik\n\n";
cout << "0.Exit\n";
int c;
cin >> c;
system("cls");

if(!cin)
{
  cout << "FATAL ERROR!\n";
  cout << "Exiting in 5 seconds!\n";
  Sleep(5000);
  return 1;
}

switch (c)
{

case 0 :
{
 system("cls");
 cout << "Blagodarq, che ispolzvhate tazi programa!\n";
 Sleep(5000);
 return 0;
}

case 1 :
{
 cout << "1.Lice i perietur na triugulnik\n";
 cout << "===============================\n";
 double a , b , c , h , P , S;
 cout << "stranata a = ";
 cin >> a;
 cout << "stranata b = ";
 cin >> b;
 cout << "stranata c = ";
 cin >> c;
 cout << "visochinata h = ";
 cin >> h;
 P = a + b + c;
 S = (a*b)*h/2;
 cout << "\n";
 cout << "P = " << setprecision(3) << setiosflags(ios::fixed) << P << "\n";
 cout << "S = " << setprecision(3) << setiosflags(ios::fixed) << S << "\n\n";
 cout << "Programata shte produlji sled malko\n";
 Sleep(5000);
 system("cls");
 break;
}

case 2 :
{
 cout << "2.Lice i perietur na pravougulen triugulnik\n";
 cout << "===========================================\n";
 double a , b , c , P , S;
 cout << "stranata a = ";
 cin >> a;
 cout << "stranata b = ";
 cin >> b;
 cout << "stranata c = ";
 cin >> c;
 P = a + b + c;
 S = (a*b)/2;
 cout << "\n";
 cout << "P = " << setprecision(3) << setiosflags(ios::fixed) << P << "\n";
 cout << "S = " << setprecision(3) << setiosflags(ios::fixed) << S << "\n\n";
 cout << "Programata shte produlji sled malko\n";
 Sleep(5000);
 system("cls");
 break;
}

case 3 :
{
 cout << "3.Lice i perietur na pravougulnik\n";
 cout << "=================================\n";
 double a , b , P , S;
 cout << "stranata a = ";
 cin >> a;
 cout << "stranata b = ";
 cin >> b;
 P = 2*a + 2*b;
 S = a*b;
 cout << "\n";
 cout << "P = " << setprecision(3) << setiosflags(ios::fixed) << P << "\n";
 cout << "S = " << setprecision(3) << setiosflags(ios::fixed) << S << "\n\n";
 cout << "Programata shte produlji sled malko\n";
 Sleep(5000);
 system("cls");
 break;
}

case 4 :
{
 cout << "4.Lice i perietur na kvadrat\n";
 cout << "============================\n";
 double a , P , S;
 cout << "stranata a = ";
 cin >> a;
 P = 4*a;
 S = a*a;
 cout << "\n";
 cout << "P = " << setprecision(3) << setiosflags(ios::fixed) << P << "\n";
 cout << "S = " << setprecision(3) << setiosflags(ios::fixed) << S << "\n\n";
 cout << "Programata shte produlji sled malko\n";
 Sleep(5000);
 system("cls");
 break;
}

case 5 :
{
 cout << "5.Lice i perietur na trapec\n";
 cout << "===========================\n";
 double a , b , c , d , h , P , S;
 cout << "stranata a = ";
 cin >> a;
 cout << "stranata b = ";
 cin >> b;
 cout << "stranata c = ";
 cin >> c;
 cout << "stranata d = ";
 cin >> d;
 cout << "visochinata h = ";
 cin >> h;
 P = a + b + c + d;
 S = (a+b)*h/2;
 cout << "\n";
 cout << "P = " << setprecision(3) << setiosflags(ios::fixed) << P << "\n";
 cout << "S = " << setprecision(3) << setiosflags(ios::fixed) << S << "\n\n";
 cout << "Programata shte produlji sled malko\n";
 Sleep(5000);
 system("cls");
 break;
}

case 6 :
{
 cout << "6.Obkolka i lice na okrujnost\n";
 cout << "=============================\n";
 double r , PI = 3.14 , P , S;
 cout << "radiusa r = ";
 cin >> r;
 P = 2*PI*r;
 S = PI*r*r;
 cout << "\n";
 cout << "P = " << setprecision(3) << setiosflags(ios::fixed) << P << "\n";
 cout << "S = " << setprecision(3) << setiosflags(ios::fixed) << S << "\n\n";
 cout << "Programata shte produlji sled malko\n";
 Sleep(5000);
 system("cls");
 break;
}

case 7 :
{
 cout << "7.Lice i perietur na romb\n";
 cout << "=========================\n";
 double a , h , P , S;
 cout << "stranata a = ";
 cin >> a;
 cout << "visochinata h = ";
 cin >> h;
 P = 4*a;
 S = a*h;
 cout << "\n";
 cout << "P = " << setprecision(3) << setiosflags(ios::fixed) << P << "\n";
 cout << "S = " << setprecision(3) << setiosflags(ios::fixed) << S << "\n\n";
 cout << "Programata shte produlji sled malko\n";
 Sleep(5000);
 system("cls");
 break;
}

case 8 :
{
 cout << "8.Lice i perietur na usporednik\n";
 cout << "===============================\n";
 double a , b , h , P , S;
 cout << "stranata a = ";
 cin >> a;
 cout << "stranata b = ";
 cin >> b;
 cout << "visochinata h = ";
 cin >> h;
 P = 2*a + 2*b;
 S = a*h;
 cout << "\n";
 cout << "P = " << setprecision(3) << setiosflags(ios::fixed) << P << "\n";
 cout << "S = " << setprecision(3) << setiosflags(ios::fixed) << S << "\n\n";
 cout << "Programata shte produlji sled malko\n";
 Sleep(5000);
 system("cls");
 break;
}

}
}
while (true);
}


